<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>qc</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/vs2015.css">
    <script src="js/highlight.min.js"></script>
    <script src="js/jquery-1.11.2.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/qc.min.js"></script>
    <style>
        .font16{
            font-size: 16px!important;
        }
        .active{
            background: rgba(255, 255, 255, .05)
        }
    </style>
</head>
<body>
<nav class="navbar navbar-inverse">
    <div class="container">
        <ul class="nav navbar-nav">
            <li>
                <a href="index.html">QC</a>
            </li>
            <li>
                <a class="font16" href="index.html">首页</a>
            </li>
            <li>
                <a class="font16" href="api.html">API文档</a>
            </li>
            <li class="active">
                <a class="font16" href="module.html">模块化</a>
             </li>
            <li>
                <a class="font16" target="_blank" href="example/">示例</a>
             </li>
        </ul>
    </div>
</nav>
<div class="container">
        <div class="col-sm-12">
            <div class="row">
<div class="panel-body" id="txt-code">
    <h5>QC自带模块加载器,模块加载器需要发Ajax请求，说以需要你一个http server。<a style="color:#0ae" href="example/example.zip">下载</a>示例</h5>
    <pre class="javascript">
    out=function () {
        console.log("hello");
    }
    var Test = need("$url:test.js");
    Test();
    </pre>
<h5>加载模块</h5>              
<pre class="javascript">
    var str = need("$url:xxxxx!text");
</pre>
<br />
<ul>
    <li><h5>相对路径 path:need("$url:xxxxx"),need("$url:../xxxxx")</h5></li>
    <li><h5>据对路径 path:need("$url:/xxxxx")</h5></li>
    <li><h5>"$url:" 是必须的</h5></li>
</ul>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
</html>
<script>
    $("#txt-code").find("pre").each(function (i, block) {
        hljs.highlightBlock(block);
    })
    hljs.initHighlightingOnLoad();
</script>